Example: Coding in C/C++ from Pascal (Cont.)
wfunction gcd(a,b: integer): integer;
w(* Compute gcd of a, b  *)
wvar temp: integer;
wbegin
w while b <> 0 do
w begin
w   temp := a mod b;
w   a := b;
w   b := temp
w end;
w gcd := a
wend;
int gcd(int a, int b)
{
}
int temp;
while (b != 0)
{
}
temp = a % b;
return a;
b = temp;
a = b;